#pragma once
#include "Player.h"
/** \class GameRules
	\brief Class which include all rules for each game.

	You have to make a derived class from this class (YOURGAMERules)
	and implement all the function which are not implemented already
	that is, isLegal() and initPlayers()
*/
class GameRules
{
public:
	/** 
	*Empty constructor
	*/
	GameRules() { };

	/** 
	*virtual destructor
	*/
	virtual ~GameRules() { };

	/** 
	* Legal moves for game
	* Returns true if move is legal, false otherwise
	*/
	virtual bool isLegal(int fromX, int fromY, int toX, int toY) { return false; };

	/** 
	* Initialize players on board.
	* Takes the grid for the board as argument and the two players
	* Initializes the grid for the two players, as current Game rules apply
	*/
	virtual void initPlayers(std::vector< std::vector<char> >& grid, Player& p1, Player& p2){ };

	/**
	*Returns max moves for game
	*/
	virtual int getMaxMoves(){ return m_maxMoves;}

	/** 
	*Returns Terminal. 
	*/
	virtual int getTerminal(){return 0;} 
protected:	
	int m_piecesPerPlayer; ///< number of pieces each player begins with
	int m_maxMoves; ///< Max moves in game before tie
};

